<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Dubbo动态发布系统</title>
</head>
<body>
<!-- Content Wrapper. Contains page content -->
<div ng-controller="undeployController">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            服务管理
            <small>主机列表</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i>服务管理</a></li>
            <li><a href="#">主机列表</a></li>
        </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row" >
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <div class="row">
                            <div class="col-xs-3">
                                <div class="input-group">
                                    <button type="button" ng-click="addOrUpdateModel(0)"
                                            class="btn btn-primary">添加服务
                                    </button>
                                    </span>
                                </div>
                            </div>

                        </div>

                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <table id="table1"
                               class="table table-bordered  table-striped table-hover">
                            <thead>
                            <tr>
                                <th>Id</th>
                                <th>BeanId</th>
                                <th>Protocol</th>
                                <th>Port</th>
                                <th>Group</th>
                                <th>Interface</th>
                                <th>Service</th>
                                <th>Version</th>
                                <th>Filter</th>
                                <th>Timeout</th>
                                <th>Operation</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in data| filter:search">
                                <td>{{item.id}}</td>
                                <td>{{item.beanId}}</td>
                                <td>{{item.protocol}}</td>
                                <td>{{item.port}}</td>
                                <td>{{item.groupName}}</td>
                                <td>{{item.interfaceName}}</td>
                                <td>{{item.serviceName}}</td>
                                <td>{{item.version}}</td>
                                <td>{{item.filter}}</td>
                                <td>{{item.timeout}}</td>
                                <td>
                                    <button class="btn btn-primary btn-sm" ng-click="addOrUpdateModel(item.id)">
                                        <i class="glyphicon glyphicon-edit">编辑</i>
                                    </button>
                                    <button class="btn btn-info btn-sm"
                                            ng-click='export(item.id)'>发布
                                    </button>
                                    <button class="btn btn-danger btn-sm" ng-click="deleteService(item.id)" type="button">
                                        <i class="fa fa-trash-o">删除</i>
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>
    <!-- /.content -->
    <div class='modal' id='addServiceModal'>
        <div class='modal-dialog'>
            <div class='modal-content'>
                <div class='modal-header'>
                    <button type='button' class='close' data-dismiss='modal'>
                        <span aria-hidden='true'>×</span><span class='sr-only'>Close</span>
                    </button>
                    <h4 class='modal-title'>添加服务</h4>
                </div>
                <div class='modal-body'>
                    <input type="hidden" name="id" ng-model="serviceConfig.id">
                    <div class='form-group'>
                        <label>服务名称：</label>
                        <input type='text'
                               class='form-control' name="beanId" ng-model="serviceConfig.beanId" >
                    </div>
                    <div class='form-group'>
                        <label>接口全路径:</label>
                        <input type='text' class='form-control' name="interfaceName" ng-model="serviceConfig.interfaceName"
                               placeholder='example: com.vcg.dubbo.service.UserService'>
                    </div>
                    <div class='form-group'>
                        <label>实现类全路径:</label>
                        <input type='text' class='form-control' name="serviceName" ng-model="serviceConfig.serviceName"
                               placeholder='example: com.vcg.dubbo.service.UserServiceImpl'>
                    </div>

                    <div class='form-group'>
                        <label>组:</label>
                        <input type='text' class='form-control' name="groupName" ng-model="serviceConfig.groupName" >
                    </div>

                    <div class='form-group'>
                        <label>版本:</label>
                        <input type='text' class='form-control' name="version" ng-model="serviceConfig.version">
                    </div>


                    <div class='form-group'>
                        <label>过滤器:</label>
                        <input type='text' class='form-control' name="filter" ng-model="serviceConfig.filter"
                               placeholder='example: filter1,filter2'>
                    </div>

                    <div class='form-group'>
                        <label>超时(毫秒):</label>
                        <input type='number' value="1000" class='form-control' name="timeout" ng-model="serviceConfig.timeout">
                    </div>


                    <div class='modal-footer'>
                        <button type='button' class='btn btn-default'
                                data-dismiss='modal'>关闭
                        </button>
                        <button ng-click="addOrUpdate(serviceConfig.id)" class='btn btn-primary'>完成</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


</body>

<!-- /.content-wrapper -->
</html>